# coding=utf-8
# 全世界最帅的帅哥
from flask import Flask
from ysgg1_club_oss.controller.file_controller import test_minio
from ysgg1_club_oss.controller.file_controller import test_nacos
from ysgg1_club_oss.config.oss_config import OssConfig
from ysgg1_club_oss.nacos_registry.register_server import register_service
from ysgg1_club_oss.oss_resources import oss_bp


def create_app():
    app = Flask(__name__)
    app.config.from_object(OssConfig)
    app.add_url_rule("/testGetAllBuckets", "file_controller", test_minio, methods=["GET"])
    app.add_url_rule("/testNacos", "test_nacos", test_nacos, methods=["GET"])

    register_service()

    app.register_blueprint(oss_bp)

    return app
